home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / vim_doc.zip / INDEX < prev    next >
Text File  |  1993-01-12  |  18KB  |  505 lines

  1. index of vim commands for
  2.  1. insert mode
  3.  2. VI commands (normal mode)
  4.  3. command line editing
  5.  4. EX commands
  6.  
  7. (for an overview of options see the end of reference.doc)
  8.  
  9. 1. INSERT MODE
  10. ==============
  11.  
  12. char        action
  13. -----------------------------------------------------------------------
  14. ^@        insert previously inserted text and stop insert {vi: up to 128
  15.         chars}
  16. ^A        insert previously inserted text {vi: no ^A}
  17. ^B <0-9a-z>    insert contents of register <0-9a-z> {not in vi}
  18. ^D        delete one shiftwidth of indent in the current line {vi: 
  19.         only after auto-indent}
  20. ^E        insert the character which is below the cursor
  21. ^H <BS>        delete character before the cursor {vi: does not cross lines,
  22.         does not delete autoindents}
  23. ^J <LF>        begin new line
  24. ^O        execute a single command and return to insert mode
  25. ^M <CR>        begin new line
  26. ^R        insert the character which is above the cursor
  27. ^T        insert one shiftwidth of indent in current line {vi: only in 
  28.         autoindent}
  29. ^U        delete all entered characters in the current line
  30. ^V        insert next non-digit literally, insert three digit decimal 
  31.         number as a single byte.
  32. ^W        delete word before the cursor
  33. ^[ <ESC>    end insert mode
  34. <DEL>        same as ^H <BS>
  35. <C_UP>        cursor one line up
  36. <C_DOWN>    cursor one line down
  37. <C_LEFT>    cursor one character left
  38. <C_RIGHT>    cursor one character right
  39. <SC_UP>        one screenfull backward
  40. <SC_DOWN>    one screenfull forward
  41. <SC_LEFT>    cursor one word left
  42. <SC_RIGHT>    cursor one word right
  43. {char1}<BS>{char2} enter digraph (only when compiled with it) {vi: no digraphs}
  44.  
  45.  
  46. 2. VI COMMANDS
  47. ==============
  48.  
  49. CHAR means non-blank char
  50. WORD means sequences of non-blank chars
  51. N is number entered before the command
  52. <move> is a cursor movement command
  53. Nmove is the text that is moved over with a cursor movement command
  54. SECTION is a section that possibly starts with '}' instead of '{'
  55.  
  56. note: 1 = cursor movement command; 2 = can be undone/redone
  57.  
  58. char        note    vim normal mode (vi: what the unix vi does)
  59. ------------------------------------------------------------------------------
  60. ^@            error
  61. ^A        2    add N to number at/after cursor {vi: no ^A}
  62. ^B        1    scroll N screens Backwards
  63. ^C            interrupt current (search) command
  64. ^D            scroll Down N lines (default: half a screen)
  65. ^E            scroll N lines upwards (N lines Extra)
  66. ^F        1    scroll N screens Forward
  67. ^G            display current file name and position
  68. ^H <BS>        1    cursor N chars to the left
  69. ^I <TAB>    1    go to N newer entry in jump list
  70. ^J <LF>        1    cursor N lines downward
  71. ^K            error
  72. ^L            redraw screen
  73. ^M <CR>        1    cursor to the first CHAR N lines lower
  74. ^N        1    cursor N lines downward
  75. ^O        1    go to N older entry in jump list
  76. ^P        1    cursor N lines upward
  77. ^Q            start blockwise quoting (vi: no quoting)
  78. ^R        2    redo changes which were undone with 'u' (vi: no redo)
  79. ^S        2    subtract N from number at/after cursor {vi: no ^S}
  80. ^T            jump to N older Tag in tag list
  81. ^U            scroll N lines Upwards (default: half a screen)
  82. ^V            error
  83. ^W            error
  84. ^X            error
  85. ^Y            scroll N lines downwards
  86. ^Z            suspend program (or start new shell)
  87. ^[ <ESC>        error
  88. ^\            error
  89. ^]            :ta to ident under cursor
  90. ^^            edit Nth alternate file (equivalent to :e #N)
  91. ^_            error
  92.  
  93. <SPACE>        1    cursor N chars to the right
  94. !<move><filter>        filter Nmove text through the "filter" command
  95. !!<filter>        filter N lines through the "filter" command
  96. "<a-zA-Z0-9.>        use buffer <a-zA-Z0-9.> for next delete, yank or put
  97.             (upper case to append)(<.> only works for put)
  98. #        1    search backward for the Nth occurrence of the ident under
  99.             the cursor {not in vi}
  100. $        1    cursor to the end of line N from the cursor
  101. %        1    find the next (curly/square) bracket on this line and go
  102.             to its match. With count: go to N percentage in the file.
  103. &        2    repeat last :s
  104. '<a-z>        1    cursor to the first CHAR on the line with mark <a-z>
  105. ''        1    cursor to the first CHAR of the line where the cursor was
  106.             before the latest jump.
  107. (        1    cursor N sentences backward
  108. )        1    cursor N sentences forward
  109. *        1    search forward for the Nth occurrence of the ident under
  110.             the cursor {not in vi}
  111. +        1    cursor to the first CHAR N lines lower
  112. ,        1    repeat latest f, t, F or T in opposite direction N times
  113. -        1    cursor to the first CHAR N lines higher
  114. .        2    repeat last change with count replaced by N
  115. /<pattern>    1    search forward for the Nth occurrence of <pattern>
  116. 0        1    cursor to the first char of the line
  117. 1            prepend to command to give a count
  118. 2            "
  119. 3            "
  120. 4            "
  121. 5            "
  122. 6            "
  123. 7            "
  124. 8            "
  125. 9            "
  126. :            Ex command (see below)        
  127. ;        1    repeat latest f, t, F or T N times
  128. <<move>        2    shift the Nmove lines one shiftwidth leftwards
  129. <<        2    shift N lines one shiftwidth leftwards
  130. =<move>        2    filter Nmove lines through "indent" (vi: when option
  131.             'lisp' is set autoindent Nmove lines)
  132. ==        2    filter N lines through "indent"
  133. ><move>        2    shift Nmove lines one shiftwidth rightwards
  134. >>        2    shift N lines one shiftwidth rightwards
  135. ?<pattern>    1    search backward for the Nth previous occurrence of
  136.             <pattern>
  137. @<a-z>        2    execute the contents of named buffer <a-z> N times
  138. @@        2    repeat the previous @<a-z> N times
  139. A        2    append text at the end of the line N times
  140. B        1    cursor N WORDS backward
  141. <"x>C        2    change from the cursor position to the end of the line,
  142.             and N-1 more lines [into buffer x]; synonym for c$
  143. <"x>D        2    delete the characters under the cursor until the end of
  144.             the line and N-1 more lines [into buffer x]; synonym for d$
  145. E        1    cursor forward to the end of WORD N
  146. F<char>            cursor to the Nth occurrence of <char> to the left
  147. G        1    cursor to line N, default last line
  148. H        1    cursor to line N from top of screen
  149. I        2    insert text before the first CHAR on the line N times
  150. J        2    Join N lines; default is 2
  151. K            lookup Keyword under the cursor with "keywordprg"
  152. L        1    cursor to line N from bottom of screen
  153. M        1    cursor to middle line of screen
  154. N        1    repeat the latest '/' or '?' N times in opposite
  155.             direction
  156. O        2    begin a new line above the cursor and insert text, repeat
  157.             N times (vi: blank N screen lines)
  158. <"x>P        2    put the text [from buffer x] before the cursor N times
  159. Q            start quoting lines (vi: go to Ex mode)
  160. R        2    enter replace mode: overtype existing characters, repeat the
  161.             entered text N-1 times
  162. <"x>S        2    delete N lines [into buffer x] and start insert; synonym
  163.             for ^cc or 0cc, depending on autoindent
  164. T<char>        1    cursor till after Nth occurrence of <char> to the left
  165. U        2    undo all latest changes on one line (vi: while not moved
  166.             off of it)
  167.             While quoting: make lowercase
  168. V<move>        2    Join N lines and re-format them
  169. W        1    cursor N WORDS forward
  170. <"x>X        2    delete N characters before the cursor [into buffer x]
  171. <"x>Y            yank N lines [into buffer x]; synonym for yy
  172. ZZ            store current file, if modified, and exit        
  173. [[        1    cursor N sections backward
  174. []        1    cursor N SECTIONS backward
  175. \            error
  176. ]]        1    cursor N sections forward
  177. ][        1    cursor N SECTIONS forward
  178. ^        1    cursor to the first CHAR of the line
  179. _        1    cursor to the first CHAR N - 1 lines lower
  180. `<a-z>        1    cursor to the mark <a-z>
  181. ``        1    cursor to the position before latest jump
  182. a        2    append text after the cursor N times
  183. b        1    cursor N words backward
  184. <"x>c<move>    2    delete Nmove text [into buffer x] and start insert
  185. <"x>cc        2    delete N lines [into buffer x] and start insert
  186. <"x>d<move>    2    delete Nmove text [into buffer x]
  187. <"x>dd        2    delete N lines [into buffer x]
  188. e        1    cursor forward to the end of word N
  189. f<char>        1    cursor to Nth occurrence of <char> to the right
  190. g            error
  191. h        1    cursor N chars to the left
  192. i        2    insert text before the cursor N times
  193. j        1    cursor N lines downward
  194. k        1    cursor N lines upward
  195. l        1    cursor N chars to the right
  196. m<a-z>            set mark <a-z> at cursor position        
  197. n        1    repeat the latest '/' or '?' N times
  198. o        2    begin a new line below the cursor and insert text, repeat
  199.             N times (vi: blank N screen lines)
  200.             While quoting: cursor moves other end
  201. <"x>p        2    put the text [from buffer x] after the cursor N times
  202. q            start quoting characters
  203. r<char>        2    replace N chars by <char>
  204. <"x>s        2    (substitute) delete N characters [into buffer x] and
  205.             start insert
  206. t<char>        1    cursor till before Nth occurrence of <char> to the right
  207. u        2    undo changes (vi: only one level)
  208.             While quoting: make uppercase
  209. v<a-zA-Z>        record typed characters into named buffer <a-zA-Z>
  210.             (upper case to append)
  211. v            stops recording (vi: no recording)
  212. w        1    cursor N words forward
  213. <"x>x        2    delete N characters under and after the cursor [into
  214.             buffer x]
  215. <"x>y<move>        yank Nmove text [into buffer x]
  216. <"x>yy            yank N lines [into buffer x]
  217. z<CR>            redraw, cursor line to top of window        
  218. z.            redraw, cursor line to center of window
  219. z-            redraw, cursor line at bottom of window
  220. {        1    cursor N paragraphs backward
  221. |        1    cursor to column N
  222. }        1    cursor N paragraphs forward
  223. ~        2    option notildeop: switch case of N characters under
  224.             cursor and move the cursor N characters to the right
  225.             (vi: no count)
  226. ~<move>            option tildeop: switch case of Nmove text (vi: no tildeop
  227.             option)
  228. <DEL>            when entering a number: remove the last digit
  229. <HELP>            show the file vim:vim.hlp page by page (vi: no help)
  230. <C_UP>        1    move cursor N lines upwards
  231. <C_DOWN>    1    move cursor N lines downwards
  232. <C_LEFT>    1    move cursor N chars to the left
  233. <C_RIGHT>    1    move cursor N chars to the right
  234. <SC_UP>        1    scroll N screens Backwards (same as ^B)
  235. <SC_DOWN>    1    scroll N screens Forwards (same as ^F)
  236. <SC_LEFT>    1    cursor N words backward (same as b)
  237. <SC_RIGHT>    1    cursor N words forward (same as w)
  238.  
  239.  
  240. 3. command line editing
  241. =======================
  242.  
  243. Get to the command line with the ':', '!', '/' or '?' commands.
  244. Normal characters are inserted at the current cursor position.
  245. (vi: can only alter last character in the line)
  246.  
  247. ^D        list filenames that match the pattern in front of the cursor
  248. ^H        delete the character in front of the cursor
  249. ^N        only after an <ESC> with multiple matches: go to next match
  250. ^P        only after an <ESC> with multiple matches: go to previous match
  251. ^V        insert next non-digit literally, insert three digit decimal 
  252.         number as a single byte. {Vi: type the CTRL-V twice to get one}
  253. <ESC>           do filename completion on the pattern in front of the cursor
  254. @        remove all characters
  255. <DEL>        delete the character under the cursor
  256. <C_UP>        recall previous command line from history
  257. <C_DOWN>    recall next command line from history
  258. <C_LEFT>    cursor left
  259. <C_RIGHT>    cursor right
  260. <SC_LEFT>    cursor one word left
  261. <SC_RIGHT>    cursor one word right
  262.  
  263.  
  264. 4. EX commands
  265. ==============
  266.  
  267. lines that start with " or # are ignored
  268.  
  269. <range> stands for a series of line specifiers, separated with ',' or ';'.
  270. When separated with ';' the cursor position will be set to that line before
  271. interpreting the next line specifier.
  272. The default line specifier (for most commands) is the Cursor position.
  273. line numbers may be specified with:
  274.     <number>    the absolute line number
  275.     .        the current line
  276.     $        the last line in the file
  277.     %        equal to 1,$ (the entire file)
  278.     't        position of mark t
  279.     /<pattern>    the next line where <pattern> matches
  280.     ?<pattern>    the previous line where <pattern> matches
  281. Each may be followed (several times) by '+' or '-' and an optional number.
  282. This number is added or subtracted from the preceding line number.
  283. if the number is omitted, 1 is used.
  284. Examples:
  285.     .+3        three lines below the cursor
  286.     /that+1        the line below the next line containing "that"
  287.     .,$        from current line until end of file
  288.  
  289. In the commands below the characters in square brackets are optional.
  290.  
  291. :<range>        set the cursor on the (last) specified line number
  292.  
  293. :a[ppend]        {vi: append text}
  294.  
  295. :ar[gs]            print the file list, with the current file in []
  296.  
  297. :cc [nr]        Display error [nr] (default is same error)
  298.  
  299. :cd            print the current directory name {vi: no such command}
  300. :cd <path>        change the current directory to <path>
  301.  
  302. :cf            read error file (from errorfile option)
  303.  
  304. :c[hange]        {vi: replace lines}
  305.  
  306. :ch[dir]        same as :cd
  307.  
  308. :cn            display next error
  309.  
  310. :[range]co[py] {address} copy lines from [range] to {address}
  311.  
  312. :cp            display previous error
  313.  
  314. :cq            Quit without writing and return an error code
  315.  
  316. :[<range>]d[elete] [x] [count]
  317.             delete <range> lines (default: current line)
  318.  
  319. :dig[raph]        display currently defined digraphs {not in vi}
  320.  
  321. :dig[raph] {char1}{char2} {number} ...
  322.             define the character pair {char1} {char2} to be the 
  323.             digraph for character {number}. {number} is entered 
  324.             as digits.
  325.  
  326. :di[splay]        display the contents of numbered and named buffers
  327.             {vi: no such command}
  328.  
  329. :e[dit] [file]        edit 'file' (default: current file), unless changes have
  330.             been made {vi: allow +n to start at certain position}
  331. :e[dit]! [file]        edit 'file' (default: current file) always
  332.  
  333. :ex            same as :edit
  334.  
  335. :f[ile]            prints the current file name and some more info
  336. :f[ile] <name>        sets current file name to <name>
  337. :files            lists the alternate file names
  338.  
  339. :<range>g[lobal]/<pattern>/<cmd>
  340.             execute the EX command <cmd> on the lines where <pattern>
  341.             matches
  342. :<range>g[lobal]!/<pattern>/<cmd>
  343.             execute the EX command <cmd> on the lines where <pattern>
  344.             does not match
  345.  
  346. :h[elp]            show the help file page by page {vi: no help}
  347.  
  348. :i[nsert]        {vi: insert text}
  349.  
  350. :<range>j[oin]        join <range> lines
  351.  
  352. :ju[mps]        print jump list {vi: no such command}
  353.  
  354. :[range]k<a-z>        set mark without a space
  355.  
  356. :l[ist]            {vi: list lines}
  357.  
  358. :map <lhs> <rhs>    map the key sequence <lhs> to <rhs> in normal mode
  359. :map! <lhs> <rhs>    map the key sequence <lhs> to <rhs> in insert mode
  360.  
  361. :[range]ma[rk] <a-z>    set mark
  362.  
  363. :marks            list all marks {vi: no such command}
  364.  
  365. :mk[exrc]        {vi: write options to .exrc file}
  366.  
  367. :[range]m[ove] {address} move lines from [range] to {address}
  368.  
  369. :n[ext]            edit next file, unless changes have been made
  370. :n[ext]!        edit next file
  371. :n[ext] <filelist>    define <filelist> as the new list of files and edit
  372.             the first one, unless changes have been made
  373. :n[ext]! <filelist>    define <filelist> as the new list of files and edit
  374.             the first one {vi: +command to start editing at a
  375.             specified position}
  376.  
  377. :nu[mber]        {vi: print specified lines with their line number}
  378.  
  379. :N[ext]            edit previous file in file list, unless changes have
  380.             been made
  381. :N[ext]!        edit previous file in file list
  382.  
  383. :o[pen]            {vi: start editing in open mode}
  384.  
  385. :[count]po[p][!]    jump to [count] older tag in tag list {vi: no such command}
  386.  
  387. :pres[erve]        {vi: emergency exit}
  388.  
  389. :<range>p[rint]        print the specified lines
  390.  
  391. :pu[t] [x]        insert text from buffer [x] below current line
  392. :pu[t]! [x]        insert text from buffer [x] above current line
  393.  
  394. :pr[evious]        same as :Next
  395.  
  396. :q[uit]         quit, unless changes have been made
  397. :q[uit]!        quit always, without writing
  398.  
  399. :r[ead] <name>        insert the file <name> below the cursor
  400. :r[ead]!<cmd>        excute <cmd> and insert its standard output below the
  401.             cursor
  402.  
  403. :rec[over]        {vi: recover a file after a crash or :preserve}
  404.  
  405. :rew[ind]        start editing the first file in the file list, unless
  406.             changes have been made
  407. :rew[ind]!        start editing the first file in the file list
  408.  
  409. :se[t]            show all modified options {vi: non-default options}
  410. :se[t] all        show all options
  411. :se[t] <option>        set toggle option on, show value of string or number
  412.             option
  413. :se[t] no<option>    set toggle option off
  414. :se[t] inv<option>    invert toggle option
  415. :se[t] <option>=<value> set string or number option to <value>
  416. :se[t] <option>?    show value of <option>
  417.  
  418. :sh[ell]        escape to a shell {vi: shell name from option 'shell'}
  419.  
  420. :so[urce] <file>    read EX commands from <file>
  421. :so[urce]! <file>    read VI commands from <file> {vi: no such command}
  422.  
  423. :st[op][!]        suspend the editor
  424.  
  425. :<range>s[ubstitute]/<pattern>/<string>/<option>
  426.             for each line in <range> replace the first occurrence of
  427.             <pattern> by <string>; with <option> 'g' all occurrences
  428.             on the line are replaced; with <option> 'c' each
  429.             replace has to be confirmed
  430. :<range>s[ubstitute]    repeat last :substitute
  431.  
  432. :t            synonym for copy
  433.  
  434. :ta[g] <ident>        search for <indent> in the tags file and execute
  435.             the accompanying command, unless changes have been made
  436. :ta[g]! <ident>        search for <indent> in the tags file and execute
  437.             the accompanying command
  438.  
  439. :[count]ta[g][!]    jump to [count] newer tag in tag list {vi: no such command}
  440.  
  441. :tags            print the tag list {vi: no such command}
  442.  
  443. :una[bbreviate]        {vi: remove from abbreviation list}
  444.  
  445. :u[ndo]            undo last change
  446.  
  447. :unm[ap] <lhs>        remove the mapping of <lhs> for normal mode
  448. :unm[ap]! <lhs>        remove the mapping of <lhs> for insert mode
  449.  
  450. :ve[rsion]        print the version number of the editor
  451.  
  452. :<range>v[global]/<pattern>/<cmd>
  453.             execute the EX command <cmd> on the lines where <pattern>
  454.             does not match
  455.  
  456. :vi[sual]        {vi: switch from EX or open to visual mode}
  457.  
  458. :wi[nsize] <width> <height>
  459.             Set effective window size to <width> columns and <height>
  460.             rows. Does not change actual window size. Should only be
  461.             used from script files. {vi: no such command}
  462.  
  463. :<range>w[rite][!]    write the specified lines to the current file
  464. :<range>w[rite]    <file>    write the specified lines to <file>, unless it
  465.             already exists
  466. :<range>w[rite]! <file>    write the specified lines to <file>
  467. :<range>w[rite][!] >>    append the specified lines to the current file
  468. :<range>w[rite][!] >> <file>
  469.             append the specified lines to <file>
  470. :<range>w[rite] !<cmd>    execute <cmd> with <range> lines as standard input
  471.  
  472. :wq            write the current file and exit if no more files
  473. :wq!            write the current file and exit
  474. :wq <file>        write to <file> and exit if no more files
  475. :wq! <file>        write to <file> and exit
  476.  
  477. :x[it][!] [file]    same as :wq, but write only when changes have been made
  478.  
  479. :y[ank] [x]        copy lines into buffer [x]
  480.  
  481. :z            {vi: print some lines}
  482.  
  483. :@<reg>            execute contents of buffer <reg> as an Ex command 
  484.             {only in some versions of vi}
  485.  
  486. :@@            repeat last :@<reg> command.
  487.  
  488. :![!]<cmd> [!][<arg>]    execute <cmd> with the shell, replace the optional bangs
  489.             with the previously given command, append the optional
  490.             <arg>
  491. :<range>![!]<cmd> [!][<arg>]
  492.             filter <range> lines through <cmd>, replace the optional bangs
  493.             with the previously given command, append the optional
  494.             <arg>
  495.  
  496. :<            shift left
  497.  
  498. :>            shift right
  499.  
  500. :=            print the line number
  501.  
  502. :&            same as :substitute
  503.  
  504. :~            {vi: do a substitute on the previous regular expression}
  505.